cmake_minimum_required(VERSION 3.18)

project( Lizard )

find_package(PkgConfig REQUIRED)
pkg_search_module(GLIB REQUIRED glib-2.0)
pkg_search_module(EXPAT REQUIRED expat)
pkg_search_module(IGRAPH REQUIRED igraph)
pkg_search_module(LIBCJSON REQUIRED libcjson)

set (LIB_CSV_PARSER
    lib/CsvParser/src/csvparser.c)
add_library(lib_csvparser ${LIB_CSV_PARSER})

set (LIB_INCLUDE_DIRS
        lib/CsvParser/include
        ${EXPAT_INCLUDE_DIRS}
        ${IGRAPH_INCLUDE_DIRS}
        ${LIBCJSON_INCLUDE_DIRS}
        ${GLIB_INCLUDE_DIRS})

set (LIB_LINK
        lib_csvparser
        ${EXPAT_LIBRARIES}
        ${IGRAPH_LIBRARIES}
        ${LIBCJSON_LIBRARIES}
        ${GLIB_LDFLAGS}
    )

include_directories(
    include
    parser/include
    generater/include
    ${LIB_INCLUDE_DIRS}
)

set (LIZ_PARSER
    parser/sandbox_parser.c
    parser/winprocmon_parser.c
)

set (LIZ_COMMON
    main.c
    log_elem.c
)

set (LIZ_GENERATER
    generater/default_generater.c
)

add_library(lizard_parser ${LIZ_PARSER})

add_library(lizard_generater ${LIZ_GENERATER})

add_executable(lizard ${LIZ_COMMON})

target_link_libraries(lizard lizard_parser lizard_generater)

target_link_libraries(lizard ${LIB_LINK})
